function editFigExport(figHundle, fileName, width)
% FUNCTION EDITFIGEXPORT(FIGHUNDLE, FILENAME, WIDTH) modifies a MATLAB figure specified in FIGHUNDLE and export a publication
% quality .eps file. The width of the figure is specified by WIDTH. This function contains standard parameters for figure
% parameters used in EXPORTFIG. The generated eps file is saved in
% FILENAME.
% written by Taro Kiritani, tarokiritani2008@u.northwestern.edu, 1/17/2011


% first get rid of boxes from axes.
axesObj = findobj(figHundle,'type','axes');
for k = 1:length(axesObj)
    try
        set(axesObj(k),'box','off','LineWidth',1)
        legend boxoff
    end
end

% gcf
% % insert scale bars
% line([xBarOrigin,xBarOrigin,xBarOrigin+xBarWidth],...
%     [yBarOrigin + yBarHeight,yBarOrigin,yBarOrigin],'k');
% 

% insert stars to indicate statistical significance. This part should be done
% manually in a separate function?
% starPosition = ylim;
% starPosition = starPosition(2);
% text(50,starPosition,'*','HorizontalAlignment','center','VerticalAlignment','middle')



exportfig(figHundle,fileName,'Preview','tiff','Format','eps','Width',width,'Bounds','tight',...
    'Color','rgb','Resolution',300,'LockAxes',0,'FontMode','fixed',...
    'FontSize',10,'LineMode','fixed','LineWidth',1)



